package com.team.yygh.hosp.controller;

import com.team.yygh.common.result.Result;
import com.team.yygh.model.acl.User;
import com.team.yygh.vo.acl.UserQueryVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 临时添加的调试登录界面的类
 */
@RestController
@RequestMapping(value = "/admin/hosp/user")
public class UserController {

    @ApiOperation("获取登录用户信息")
    @PostMapping(value = "/login")
    public Result login(@RequestBody User user) {
        //暂时不去数据库查:用户系统再去
        Map<String,String> map = new HashMap<>();
        map.put("token", "admin-token");
        return Result.ok(map);
    }

    @ApiOperation("获取登录用户角色信息")
    @GetMapping(value = "/info")
    public Result info(String token) {
        Map<String,String> map = new HashMap<>();
        map.put("roles", "[admin]");
        map.put("introduction", "I am a super administrator");
        map.put("avatar", "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fwww.kamvic.net%2F%3Fcloud-VdxjZTTIl0wCm3TfbmBpacjxuLGemE3H3iQx7e9hJlvDdWLnj2ZiZRqC8ww9QtH1ztBqOkE3CfRmh7l9V5wt6DE4gR7HOpG1pcsZ1QRfOIOYkfILDpYSgI_2BlDNk75oRoYIGKPQ_3D_3D.jpeg&refer=http%3A%2F%2Fwww.kamvic.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1668608925&t=3e798ccc40e296c91889c696eb3aba62");
        map.put("name", "Super Admin");
        return Result.ok(map);
    }


}
